import request from "@/util/request";
enum API {
    CATEGORY = "/share/category",
    CATEGORY_PAGE = "/share/category/page",
    CATEGORY_TREE = "/share/category/tree",
    CATEGORY_PARENTS_TREE = "/share/category/parents/tree",
}
export function reqGetCategoryPage(query: any){
    return request({
        url: API.CATEGORY_PAGE,
        method: "get",
        params: query
    });
}
export function reqGetCategoryParentsTree(){
    return request({
        url: API.CATEGORY_PARENTS_TREE,
        method: "get",
    });
}
export function reqGetCategoryTreeList(){
    return request({
        url: API.CATEGORY_TREE,
        method: "get",
    });
}
export function reqGetCategory(id: number){
    return request({
        url: API.CATEGORY + "/"+id,
        method: "get",
    });
}
export function reqAddCategory(category: any){
    return request({
        url: API.CATEGORY,
        method: "post",
        data: category,
    });
}
export function reqUpdateCategory(category: any){
    return request({
        url: API.CATEGORY,
        method: "put",
        data: category,
    });
}
